home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 227_01 / graf.s < prev    next >
Text File  |  1988-02-07  |  63KB  |  1,814 lines

  1. .tr ~ 
  2. .SA 1
  3. .PH "''Compatible graphics library''"
  4. .PF "''Page \\\\nP''"
  5. .DS C
  6. Public Domain Compatible Graphics Library
  7. .sp 1
  8. The C User's Group
  9. .sp 1
  10. Author
  11. Rainer Gerhards
  12. Petronellastr. 6
  13. D-5112 Baesweiler
  14. West Germany
  15. .sp 1
  16. Library Version
  17. 2.1, 11/15/1987
  18. .sp 1
  19. Documentation Version
  20. 2.1 (11/15/87 16:56:50)
  21. .sp 2
  22. supported operating systems
  23. MS-DOS or PC-DOS 2.0 or higher
  24. .sp 1
  25. supported C compilers
  26. Lattice C 3.0
  27. Datalight C 2.23
  28. Borland Turbo C 1.0
  29. [Microsoft C]
  30. .sp 1
  31. supported graphics cards
  32. Hercules monochrome graphics card
  33. enhanced graphics adapter (EGA)
  34. IBM std. BIOS interface
  35. Elsa PC XXHR vector graphics board
  36. .sp 1
  37. supported graphics printer
  38. Nec pinwriter P6 / P7
  39. Epson \(*TM compatible printers
  40. .sp 1
  41. supported plotters
  42. --- currently none ---
  43. .DE
  44. .bp
  45. .ll -10
  46. .in +10
  47. .fi
  48. This document describes the compatible
  49. graphics library for almost every (strong words, I know)
  50. computer. Everybody is free to copy,
  51. adapt or modify the listed sources
  52. and documentation. It would be nice, if
  53. you copy this acknowledgment and the authors
  54. name and address too.
  55. .br
  56. If you have new ideas or improvements
  57. please contact the author.
  58. .ll +10
  59. .in -10
  60. .sp 0
  61. .SK
  62. .H 1 "Introduction"
  63. .H 2 "Design history and background"
  64. .fi
  65. This library was first designed as a demonstration library for very fast
  66. assembly language routines.
  67. But after a while using it, I think that this C library is much more powerful
  68. than the assembly language library is.
  69. Ok, the assembly language library is somewhat faster, but it hasn't the ability to run on all well-known graphics devices for the IBM PC.
  70. And I think it will be a horrible task to port the library to a really different
  71. environment - an Unix machine for example.
  72. This is a much more easy task with the C language library.
  73. .br
  74. So this C library builds the base of a compatible graphics system, which will
  75. run
  76. on a CP/M machine as well as on a big Unix system.
  77. Currently only parts of the IBM personal computer hardware are supported,
  78. because I own no other hardware. I hope, that other users will help to
  79. make this library really portable and powerful.
  80. .sp 1
  81. While the first version implemented only the basic tasks, the current version
  82. (2.1) has many intersting features and is greatly enhanced
  83. above version 1.1. 
  84. It is very nice to move from one video device to another without source-code
  85. changes.
  86. I also improved the speed and memory requirements of the library dramatically,
  87. and so 
  88. I think this version covers a lot of serious projects.
  89. .sp 1
  90. I hope that some of you
  91. have some interesting ideas and algorithms and want to tell me about them.
  92. So I hope to get a full praxis-driven library.
  93. In addition, I hope that some of you want to port the low-level parts of the
  94. library to different machines and graphics environments, making the library
  95. really portable.
  96. Everybody should feel free to contact me!
  97. .H 2 "Current features"
  98. .fi
  99. The most powerful feature of the library is its compatibility and hardware
  100. independency.
  101. You may use the library on many machines, as long as there's driver
  102. available.
  103. And new drivers can be very simply added.
  104. .sp 1
  105. The library currently supports:
  106. .DL
  107. .LI
  108. switching between different display modes (graphics/nongraphics)
  109. .LI
  110. drawing pixels
  111. .LI
  112. drawing lines
  113. .LI
  114. drawing polylines
  115. .LI
  116. drawing boxes
  117. .LI
  118. filling boxes with given colors (e.g. clear windows)
  119. .LI
  120. draw any ellipses in full or in part
  121. .LI
  122. paint any region on the screen with a given color. The region is defined by
  123. a border color.
  124. .LI
  125. you may use a global coordinate system, freeing you from the given hardware
  126. parameters. Also very useful in numerical applications.
  127. .LI
  128. print graphics screens as a hardcopy function.
  129. This is currently limited to the Hercules graphics card and Epson compatible
  130. printers.
  131. .LI
  132. clear the graphics screen.
  133. .LI
  134. read the color of a specified pixel.
  135. .LI
  136. output text in different styles with user selectable foreground and background
  137. colors.
  138. .LI
  139. use a library error-code system. Errors occurred while processing graphics
  140. Information may be printed with a function like perror.
  141. .LI
  142. a full turtle graphics system
  143. .LI
  144. different device write modes.
  145. New drawing may be modifyed according to the old video contents (XOR them,
  146. e. g.).
  147. .LE
  148. .H 2 "new features and enhancements of version 2.1"
  149. The following new features, enhancements and bug fixes have been applied to
  150. the library since version 2.1:
  151. .DL
  152. .LI
  153. A bug in the medium-level header file has been fixed.
  154. The EGA-mode was defined in this header file, resulting in bad coding
  155. sequences for devices other than EGA.
  156. This define has been moved to the right place in the EGA low-level header
  157. file.
  158. .br
  159. Note that the version 1.1 distribution disk was corrupted by this bug.
  160. .LI
  161. A bad bug in herc.c, the C-part of the hercules low-level driver has been
  162. detected and removed.
  163. Mr. Decker of Nuernberg, West Germany reported my, that the given port
  164. address in this low-level driver were incorrect.
  165. As a result, the switch into the hercules graphic mode was unsuccessful.
  166. I'm sorry, the Hercules emulation I use on the QuadEGA switched always
  167. correctly to graphics mode, so I don't saw an error.
  168. Sorry to all Hercules users who only saw a black screen!
  169. This bug has been corrected (two addresses, dammed!).
  170. .LI
  171. The low-level driver for the Hercules graphics card and the EGA have been
  172. greatly improved and speeded up.
  173. New internal function calls have been added, resulting in a great speedup of
  174. the whole library code.
  175. This effect is extreme in function paint and line.
  176. .LI
  177. The hercules low-level driver has a much better hardcopy routine. 
  178. The new routine optimizes the print-output before sending it to the printer,
  179. resulting in a great decrease of print-time, if the screen is nearly blank.
  180. The more information is presented on the graphics screen, the less the
  181. decrease of print time will be, but I think it's really good for many
  182. applications.
  183. .LI
  184. The stack space needed by function paint has been dramatically reduced.
  185. It now requires only about 20% of the original space.
  186. Also the processing time has been reduced.
  187. .LI
  188. The assembly language macros have been implemented.
  189. Version 1.1 used the Lattice macros, which couldn't be distributed due
  190. to copyright limitations.
  191. The now written macro package implements all used Lattice macros in a manner,
  192. that makes moving to a new compiler an relatively easy task.
  193. Also some macros have been defined for this reason, which weren't implemented
  194. in the Lattice package.
  195. You may find the macro package also of interest for your own assembly language
  196. routines, the documentation should be good enough to use them.
  197. They are not documented as part of the library, because their internal
  198. implementation is not guaranteed to be the same in the next release.
  199. .br
  200. Nevertheless, there are some parameters the user must set to correct assemble
  201. the sources.
  202. This parameters are described below.
  203. .LI
  204. A new set of parameters have been added to the medium-/high-level header file 
  205. "graphics.h".
  206. These parameters allows it the user to modify some minor configuration
  207. parameters.
  208. The usage of this mechanism will be described below.
  209. .LI
  210. The text-output system has been added.
  211. It is currently not complete implemented, but offers a good chance to do
  212. most text-output jobs.
  213. .LI
  214. The new function polyline has been added.
  215. It allows the user to draw a complex figure or line with only one function
  216. call.
  217. It is able to work on a variable table which holds line coordinates.
  218. All the coordinates are concatenated with a user-specified color.
  219. .LI
  220. An error system has been implemented.
  221. Functions, which may detect error conditions return -1 if an actual error
  222. occurred, 0 otherwise.
  223. In case of an error return, the global variable "gr_error" may be examined
  224. for the exact error reason.
  225. The function "grperror" has been added to print the error message in a
  226. human-readable form.
  227. It is much like perror, but with increased functionality.
  228. The error system is described in greater detail below.
  229. .LI
  230. A complete turtle graphics system has been added.
  231.